home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / et / et3_0-a1.lha / et3 / src / TextReader.h < prev    next >
C/C++ Source or Header  |  1992-08-26  |  2KB  |  98 lines

  1. #ifndef TextReader_First
  2. #ifdef __GNUG__
  3. //pragma once
  4. #pragma interface
  5. #endif
  6. #define TextReader_First
  7.  
  8. #include "Object.h"
  9. #include "TextStyles.h"
  10. #include "Font.h"
  11. #include "Ink.h"
  12.  
  13. class StyledText;
  14. class RunArray;
  15. class VObject;
  16. class membuf;
  17.  
  18. //---- TextReader_First --------------------------------------------------------------
  19.  
  20. class TextReader : public Object {
  21. public:
  22.     MetaDef(TextReader);
  23.     
  24.     TextReader(StyledText *st, CharStyle *cs, ParaStyle *ps);
  25.     ~TextReader();
  26.     void Flush();
  27.     
  28.     //---- contents
  29.     void Append(byte b);
  30.     
  31.     //---- character properties
  32.     void SetFont(GrFont f);
  33.     void SetSize(int s);
  34.     void SetInk(Ink *i);
  35.     void SetFace(GrFace fc, int b);
  36.     void SetFace(GrFace fc);
  37.     void ToggleFace(GrFace fc);
  38.     
  39.     GrFont GetFont();
  40.     int GetSize();
  41.     GrFace GetFace();
  42.     Ink *GetInk();
  43.     
  44.     //---- paragraph properties     
  45.     void SetParaProp(TxtParaProp what, int value);
  46.     void SetParaProp(ParaDesc &pd);
  47.     
  48.     //---- graphic items
  49.     void InsertVObject(VObject *vop);
  50.     void InsertVisualMark(class VisualMark *vmp);
  51.     
  52. protected:
  53.     void FlushParaProp();
  54.     void FlushCharProp();
  55.  
  56. private:
  57.     StyledText *st;
  58.     RunArray *cstyles;
  59.     RunArray *pstyles;
  60.     int pos;
  61.     int runlen;
  62.     int paralen;
  63.     bool flushed;
  64.     
  65.     GrFace face;
  66.     GrFont font;
  67.     Ink *ink;
  68.     int size;
  69.     
  70.     ParaDesc paraProp;
  71.     
  72. };
  73.  
  74. //---- inlines ----------------------------------------------------------
  75.  
  76. inline GrFont TextReader::GetFont()
  77. {
  78.     return font;
  79. }
  80.  
  81. inline int TextReader::GetSize()
  82. {
  83.     return size;
  84. }
  85.  
  86. inline GrFace TextReader::GetFace()
  87. {
  88.     return face;
  89. }
  90.  
  91. inline Ink *TextReader::GetInk()
  92. {
  93.     return ink;
  94. }
  95.     
  96. #endif
  97.  
  98.